mainModule.controller('roleCtrl', ['$scope','$rootScope','$stateParams','$window', 'api','D','jbase','NgTableParams',
 function($scope,$rootScope,$stateParams,$window,api,D,jbase,NgTableParams) {

   
    $scope.tableParams = new NgTableParams({page: 1,  count: 100}, {
                  counts: [], // hide page counts control
                  getData: function ($defer, params) {
                   $defer.resolve($scope.list);
                 }
               });

   $scope.getList=function(d){
     api.role.list(d,function(data){
      $scope.list=data.data.list;
      // $scope.parent =data.data.parent;
      $scope.tableParams.reload();

    });                            	
   }
   $scope.getList({id:$stateParams.id});


 }]);


